<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/7/10 0010
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/core"   prefix="c"%>
<html>
<head>
    <title>Title</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <style>
        .jumbotron {
            text-align: center;
            background-color: #59407f;
            color: white;
        }

    </style>
</head>
<body>
<div class="jumbotron">
    <h1>安居管理系统</h1>
    <p>技术栈：serlvet jsp  boostrap jdbc 等</p>
    <p><a class="btn btn-primary btn-lg" href="/anju/add.jsp" role="button">添加</a></p>
</div>
<%-- jstl 称之为 java的标准标签库  其实就是给我们写好了一些 for 循环 if判断 --%>

  <table class="table table-striped table-bordered table-hover">
      <tr class="warning">
          <th>编号</th>
          <th>地区</th>
          <th>操作</th>
      </tr>
      <c:forEach var="s"  items="${data}">
         <tr>
             <td>${s.areaid}</td>
             <td>${s.areaname}</td>
             <td>
                 <button class="btn btn-danger" onclick="del(     ${s.areaid}   )">
                     <span class="glyphicon glyphicon-trash"></span>
                     删除
                 </button>
                 <a class="btn btn-primary" href="/anju/area/getOne?id=${s.areaid}">
                     <span class="glyphicon glyphicon-pencil"></span>
                     编辑
                 </a>
             </td>
         </tr>
      </c:forEach>
  </table>
      <script>
           function  del(id){
                if( confirm("are you ok?")  ){
                    window.location.href =  "/anju/area/delStu?id=" + id;
                }
           }


      </script>


</body>
</html>
